﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.WmsManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.WmsManagement.MaterialStoreVMs
{
    public partial class MaterialStoreTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._MaterialStore._MinStore")]
        public ExcelPropety MinStore_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.MinStore);
        [Display(Name = "_Model._MaterialStore._StoreQty")]
        public ExcelPropety StoreQty_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.StoreQty);
        [Display(Name = "_Model._MaterialStore._MaxStore")]
        public ExcelPropety MaxStore_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.MaxStore);
        [Display(Name = "_Model._MaterialStore._LastInBatch")]
        public ExcelPropety LastInBatch_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.LastInBatch);
        [Display(Name = "_Model._MaterialStore._LastInStoreTime")]
        public ExcelPropety LastInStoreTime_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.LastInStoreTime, true);
        [Display(Name = "_Model._MaterialStore._LastOutStoreTime")]
        public ExcelPropety LastOutStoreTime_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.LastOutStoreTime);
        [Display(Name = "_Model._MaterialStore._Pos")]
        public ExcelPropety Pos_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.Pos);
        [Display(Name = "_Model._MaterialStore._Material")]
        public ExcelPropety Material_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.MaterialId);
        [Display(Name = "_Model._MaterialStore._Expiration")]
        public ExcelPropety Expiration_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.Expiration);
        [Display(Name = "_Model._MaterialStore._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.CreateTime, true);
        [Display(Name = "_Model._MaterialStore._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.UpdateTime, true);
        [Display(Name = "_Model._MaterialStore._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.CreateBy);
        [Display(Name = "_Model._MaterialStore._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.UpdateBy);
        [Display(Name = "_Model._MaterialStore._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.IsValid);
        [Display(Name = "_Model._MaterialStore._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<MaterialStore>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Material_Excel.DataType = ColumnDataType.ComboBox;
            Material_Excel.ListItems = DC.Set<MaterialDoc>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class MaterialStoreImportVM : BaseImportVM<MaterialStoreTemplateVM, MaterialStore>
    {
            //import

    }

}